<template>
  <div class="wf-box">
    <div class="top-box">
      <div class="img-box">
        <img :src="driver.img" />
      </div>
      <div class="information-box">
        <div class="name-box">
          <span>{{ driver.name }}</span>
          &nbsp;&nbsp;&nbsp;
          <van-rate
            v-model="driver.driverScore"
            allow-half
            void-icon="star"
            void-color="#eee"
            size="14px"
          />
          {{ driver.driverScore }}分
        </div>
        <div class="evaluation-box">
          <span
            >订单数：{{ driver.orderNum }} &nbsp;&nbsp;&nbsp;好评率：{{
              driver.goodComment
            }}</span
          >
        </div>
      </div>
    </div>
    <div class="mian-box">
      <van-cell class="main-item" @click="mySalary">
        <van-icon name="gold-coin" size="20px" />
        &nbsp; &nbsp;我的工资
        <van-icon name="arrow" class="right-icon" />
      </van-cell>
      <van-cell class="main-item" @click="myOrder"
        ><van-icon name="column" size="20px" />&nbsp; &nbsp;我的订单<van-icon
          name="arrow"
          class="right-icon"
      /></van-cell>
      <van-cell class="main-item" @click="myEvaluation"
        ><van-icon name="chat" size="20px" />&nbsp; &nbsp;我的评价<van-icon
          name="arrow"
          class="right-icon"
      /></van-cell>
      <van-cell class="main-item" @click="personal">
        <van-icon name="setting" size="20px" />&nbsp; &nbsp;个人中心<van-icon
          name="arrow"
          class="right-icon"
      /></van-cell>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      driver: [],
      hardText: "服务列表aaa",
    };
  },
  created(){
    this.driver=this.$store.state.userStore.user
  },
  methods: {
   
    mySalary(){
      // console.log('我的工资');
      this.$router.push({
        path:'/salary',
        query:{
          hardText: "我的工资",
        }
      })
    },
    myOrder(){
      // console.log('我的订单');
       this.$router.push({
        path:'/order',
        query:{
          hardText: "我的订单",
        }
      })
    },
    myEvaluation(){
      // console.log('我的评价');
       this.$router.push({
        path:'/evaluation',
        query:{
          hardText: "我的评价",
        }
      })
    },
    personal(){
      // console.log('个人中心');
       this.$router.push({
        path:'/personal',
        query:{
          hardText: "个人中心",
        }
      })
    },
  },
};
</script>

<style lang="scss" scoped>
.wf-box {
  box-sizing: border-box;
  width: 100%;
  height: 667px;
  padding: 10px;
  background-color: #ddd;
  .top-box {
    margin-top: 20px;
    margin-left: 10px;
    .img-box {
      width: 60px;
      height: 60px;
      border-radius: 10px;
      overflow: hidden;
      float: left;
      margin-right: 20px;

      img {
        width: 60px;
        height: 60px;
      }
    }
    .information-box {
      height: 60px;
      line-height: 60px;

      .name-box,
      .evaluation-box {
        height: 30px;
        line-height: 30px;
      }
      .name-box {
        font-size: 14px;
      }
      .evaluation-box {
        font-size: 12px;
        color: #777;
      }
    }
  }

  .mian-box {
    margin-top: 40px;
    .main-item {
      margin-bottom: 10px;
      height: 46px;
      line-height: 26px;

      .right-icon {
        float: right;
        height: 26px;
        line-height: 26px;
      }
    }
  }
}
</style>